<template>
  <div>
    <HeadTitle title="登陆"
               :right="true"
               :middle="true"
               :left="true"
               @back="back">
      <template v-slot:middle>
        <h1>登陆</h1>
      </template>
      <template v-slot:right
                v-if="$route.path !== '/login/register'">
        <van-icon name="exchange"
                  @click="choice" />
      </template>
    </HeadTitle>
    <router-view />
  </div>
</template>

<script>
import HeadTitle from '_c/utils/HeadTitle.vue'
export default {
  components: { HeadTitle },
  methods: {
    back () {
      this.$router.push('/myself')
    },
    choice () {
      this.$router.push(this.$route.path === '/login/id' ? '/login/email' : '/login/id')
    }
  }
}
</script>

<style lang="less" scoped>
.van-icon {
  font-size: 30px;
}
</style>
